package com.bw.liuyushan.mvp_kotlin_lib.View

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.bw.liuyushan.mvp_kotlin_lib.Presenter.IPresenter

/**
 *MyKotlin_FirstMVPTest
 *file name is : BaseFragment
 *created by Ender on 2021/9/14 16:29.
 *author : 刘雨杉
 *Describe:
 */
abstract class BaseFragment <P : IPresenter> : Fragment(),IFragment,IView{
    lateinit var ip : P
    lateinit var views: View


    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {

        return LayoutInflater.from(context).inflate(bindLayout(), container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initView()
        initDate()
    }


    override fun <T : View> findViewById(id: Int): T {
        return views.findViewById(id)
    }

    override fun showDialog() {

    }

    override fun hideDialog() {
    }
}